using UnityEngine;
using System.Collections;

/// \class  gkDestroyOnExitGameVolume
/// \brief  Component handling the game exit (object out of the screen)
[AddComponentMenu("GK/Engine/Game/Destruction/gkDestroyOnExitGameVolume")]
public class gkDestroyOnExitGameVolume : MonoBehaviour 
{
    /// \brief  Call when owner exit an other actor
    void OnTriggerExit(Collider a_rcollisionInfo)
    {
        if (a_rcollisionInfo.gameObject.name == "GameVolume")
        {
            // Auto destroy
            Destroy(gameObject);
        }
    }
}
